class validate {
  constructor() {
    this.phoneReg = new RegExp(/^0?(13|14|15|17|18|19)[0-9]{9}/)
    this.EmailReg = new RegExp(/^\w[-\w.+]*@([A-Za-z0-9][-A-Za-z0-9]+\.)+[A-Za-z]{2,14}/)
    this.idCardReg = new RegExp(/^\d{17}[\d|x]|\d{15}/)
  }

  blur_phone(value) {
    return this.phoneReg.test(value)
  }

  blur_email(value) {
    return this.EmailReg.test(value)
  }

  blur_idCard(value) {
    return this.idCardReg.test(value)
  }

  blur_name(value){
    if( value.trim() ) {
      return true
    }
    return false
  }
}

export default new validate()
